//    Copyright (C) Kherty.  All rights reserved.
using System.Collections.Generic;
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing.Diagram
{
    internal class Constraints : IOfficeXmlSerializable
    {
        List<Constraint> _constr = new List<Constraint>();
        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read("constrLst"))
            {
                _constr.Clear();
                _constr.AddRange(c.ReadOptionalWhile<Constraint>("constr"));
            }

        }

        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write("constrLst"))
            {
                c.WriteElements(_constr);
            }
        }
    }
}